﻿Imports Microsoft.VisualBasic

Namespace My
    Public Class CheckSame

        Public Shared Function CheckSent(ByVal TableName As String, ByVal PKColumn As String, ByVal PKValue As String, ByVal ChangeColumn As String, ByVal ChangeValue As String) As Boolean
            Dim dat As New clsData
            Dim sql As New StringBuilder

            sql.Length = 0
            sql.AppendFormat("exec CheckSameData ")
            sql.AppendFormat("'{0}'", TableName)
            sql.AppendFormat(",'{0}'", PKColumn)
            sql.AppendFormat(",'{0}'", PKValue)
            sql.AppendFormat(",'{0}'", ChangeColumn)
            sql.AppendFormat(",'{0}'", ChangeValue)

            Return IIf(dat.GetData(sql.ToString(), Nothing, Data.CommandType.Text, "dt").Tables(0).Rows.Count = 0, False, True)

        End Function
    End Class

End Namespace
